package com.gosophia.orgManagement.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.organizationManagement.dto.OrganizationDTO;
import com.gosophia.organizationManagement.ws.OrganizationManagementWebService;

@Controller("ProveUpdateOrganizationCodeAction")
@Scope("prototype")
public class ProveUpdateOrganizationCodeAction extends BaseAjaxAction<OrganizationDTO>{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private boolean result;
    private String orgCode;
    private Long orgId;
    @Autowired
    private OrganizationManagementWebService organizationManagementWebService;
    @Override
    public OrganizationDTO getDetailData() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public String _execute() throws Exception {
        Long count = organizationManagementWebService.findEQOrganizationsForUpdateByOrgCode(orgCode, orgId);
        if(count>0){
            result = true;
        }else{
            result = false;
        }
        super.getRequestResult().setRsltCode("0");
        return SUCCESS;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

}
